<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>{$current['title']}-{$Think.CONFIG.title}</title>

		<meta name="keywords" content="{$Think.CONFIG.keywords}" />
		<meta name="description" content="{$Think.CONFIG.description}" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<include file="Public/head" />
   </head>

	<body class="no-skin">
		<include file="Public/header" />
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<include file="Public/sidebar" />
			<div class="main-content">
				<div class="main-content-inner">
					<!-- #section:basics/content.breadcrumbs -->
					<include file="Public/breadcrumbs" />

					<!-- /section:basics/content.breadcrumbs -->
					<div class="page-content">
						<include file="Public/set" />

						<!-- /section:settings.box -->
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
									<div style="padding-top:3cm;padding-left:5cm">
									<form class="form-horizontal" id="form" method="post" action="{:U('update')}" enctype="multipart/form-data">
									
									
									<div class="space-4"></div>
									<div style="padding-left:4cm">
										
										<div class="col-sm-9">
											<p style="font-size:20px">通过Excel批量导入设备信息</p><br/>
											<input type="file" name="device_address" id="device_address"  class="col-xs-10 col-sm-5" value="{$lock_stock['device_address']}">
											<!--<span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">如果设置SEO标题，将会在IE标题栏显示SEO标题。</span>
											</span>-->
										</div>
									</div>

								
								     

                                    
									<div class="col-md-offset-2 col-md-9">
										<div style="padding-top:2cm">
										<button class="btn btn-info submit" type="button">
											<i class="icon-ok bigger-110"></i>
											提交
										</button>

										&nbsp; &nbsp; &nbsp;
										<button class="btn" type="reset">
											<i class="icon-undo bigger-110"></i>
											重置
										</button>
									</div>
									</div>
								</form>
								</div>
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->
			<include file="Public/footer" />
			
		</div><!-- /.main-container -->

		<include file="Public/footerjs" />
		<!-- inline scripts related to this page -->
		<script type="text/javascript">
		window.onload = function(){
   			 var obj= document.getElementById("av_type");
   			
   			 	obj.fireEvent("onchange");
   			 }
		function show_or_hide(type){
              
                var type=document.getElementById("av_type").value;
				if(type == "ios"){  
                $(".hide_channel").hide(); 
                $(".hide_file_upload").hide(); 
            }else if(type =="android"){  
                $(".hide_channel").show(); 
                $(".hide_file_upload").hide();  
            } else if (type="firmware") {
            	$(".hide_channel").hide(); 
            	$(".hide_file_upload").show(); 
            }
			}
		$(document).ready(function(){     
            $(".hide_file_upload").hide();  
            $(".hide_channel").hide();
        })
    		
		$(function() {
			var editor = KindEditor.create('textarea[name="content"]',{
				uploadJson : '__PUBLIC__/kindeditor/php/upload_json.php',
				fileManagerJson : '__PUBLIC__/kindeditor/php/file_manager_json.php',
				allowFileManager : true,
				afterBlur:function(){this.sync();}  
				});

			$(".submit").click(function(){
				var type  = $("#av_type").val();
				var version = $("#av_version").val();
				var url = $("#av_url").val();
				var code = $("#av_code").val();	
                var channel=$("#av_channel0").val;
				var isurl= new RegExp("(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]");
                var iscode=/^[0-9]{1,20}$/;
				if(type==0){
					bootbox.dialog({
						title: '友情提示：',
						message: "分类必须选择。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
				}
				if(version==''){
					bootbox.dialog({
						title: '友情提示：',
						message: "版本号必须填写。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
				}
				if(url==''){
					bootbox.dialog({
						title: '友情提示：',
						message: "版本路径需要填写。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
					return;
				}
				if (!isurl.test(url)) {
					bootbox.dialog({
						title: '友情提示：',
						message: "版本路径格式错误。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
					return;
				}
				if (!iscode.test(code)) {
					bootbox.dialog({
						title: '友情提示：',
						message: "版本编码格式错误。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
					return;
				}
				if(code==''){
					bootbox.dialog({
						title: '友情提示：',
						message: "版本编码需要填写。", 
						buttons: {
							"success" : {
								"label" : "确定",
								"className" : "btn-danger"
							}
						}
					});
					return;
					return;
				}
				
					
					
				$("#form").submit();
			});
		});
		</script>
	</body>
</html>
